package com.bjbn.aesbcommonapi.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "kafka")
@Data
public class KafkaConfig {
    private String bootstrapServers;
    private Integer maxRequestSize;

    // === 大消息专用配置（新增）===

    // Producer配置
    private Producer producer = new Producer();

    @Data
    public static class Producer {
        // 缓冲区内存（字节）
        private long bufferMemory; // 512MB
        private int batchSize;
        private int lingerMs;

        // 压缩类型：none, gzip, snappy, lz4, zstd
        private String compressionType;

        // 超时时间（毫秒）
        private int maxBlockMs;
        private int requestTimeoutMs;
        private int deliveryTimeoutMs;

        // 重试策略
        private int retries;
        private int retryBackoffMs;

        // ACK模式
        private String acks;

        // Socket缓冲区
        private int sendBufferBytes;
        private int receiveBufferBytes;
        private int maxInFlightRequestsPerConnection;
    }
} 